import axios from "./axios";

export const getlogin=(data)=>{
    return axios ({
        url:'/api/v1.0/api/users/login',
        method:'POST',
        data
    })
}

// 获取菜单列表
export const getauths=()=>{
    return axios({
        url:'http://localhost:3000/auths'

    })
}

// 获取学生信息
export const getstudents=(data:any)=>{
    return axios({
        url:'/api/v1.0/api/student/list',
        params:{...data}
    })
}

// 添加
export const getaddstudents=(data:any)=>{
    return axios({
        url:'/api/v1.0/api/student',
        method:'POST',
        data
    })
}

// 删除
export const getdel=(id:number)=>{
    return axios({
        url:'/api/v1.0/api/delete?',
        method:'DELETE',
        params:{'id[]':id}
    })
}

// 编辑
export const getedit=(data:any)=>{
    return axios({
        url:'/api/v1.0/api/student',
        method:'PUT',
        data
    })
}

// 智能
export const getzhineng=()=>{
    return axios({
        url:'/api/v1.0/api/intelligentDetection/dataitem',
    })
}

// 安防
export const getanfang=()=>{
    return axios({
        url:'/api/v1.0/api/intelligentDetection/datapp'
    })
}

// 设备
export const getshebei=()=>{
    return axios({
        url:'/api/v1.0/api/intelligentDetection/dataput'
    })
}

// 地图
export const getmapJson=(data:any)=>{
   return axios({
       url:`https://geo.datav.aliyun.com/areas_v3/bound/${data}_full.json`
   })
}

// 导入
export const getdaoru=(data:any)=>{
    return axios({
        url:'/api/v1.0/api/import/students',
        method:'POST',
        data
    })
}